// 加密
function getAesString(data, key, iv) {
    var key = CryptoJS.enc.Hex.parse(key);
    var iv = CryptoJS.enc.Utf8.parse(iv);
    var encrypted = CryptoJS.AES.encrypt(data, key, {
        iv: iv,
        mode: CryptoJS.mode.CBC, // mode和pad若有变动，@hzwenjinlu@corp.netease.com
        padding: CryptoJS.pad.Pkcs5
    });
    return encrypted;
}

// 解密
function getDAesString(encrypted, key, iv) {
    var key = CryptoJS.enc.Hex.parse(key);
    var iv = CryptoJS.enc.Utf8.parse(iv);
    var decrypted = CryptoJS.AES.decrypt(encrypted, key, {
        iv: iv,
        mode: CryptoJS.mode.CBC,
        padding: CryptoJS.pad.Pkcs5
    });
    return decrypted.toString(CryptoJS.enc.Utf8);
}